//
//  UIView+YHXibExtension.m
//  LyhToolsTest
//
//  Created by 李彦宏 on 2019/3/19.
//  Copyright © 2019 LYH.com. All rights reserved.
//

#import "UIView+YHXibExtension.h"

@implementation UIView (YHXibExtension)

@dynamic cornerRadius;
@dynamic borderWidth;
@dynamic borderColor;

- (void)setCornerRadius:(CGFloat)cornerRadius {
    self.layer.cornerRadius = cornerRadius;
    self.layer.masksToBounds = (cornerRadius>0);
}

- (CGFloat)cornerRadius {
    return self.layer.cornerRadius;
}

- (void)setBorderWidth:(CGFloat)borderWidth {
    self.layer.borderWidth = borderWidth;
}

- (CGFloat)borderWidth {
    return self.layer.borderWidth;
}

- (void)setBorderColor:(UIColor *)borderColor {
    self.layer.borderColor = borderColor.CGColor;
}

- (UIColor *)borderColor {
    return [UIColor colorWithCGColor:self.layer.borderColor];
}

@end
